<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="lushu">
		<title>支票充值撤销</title>
		<script language="javascript" type="text/javascript" src="../script/print.js"></script>
		<script type="text/javascript" src="../script/common.js" language="JavaScript"></script>
		<script type="text/javascript" language="JavaScript">
			var Page;
			function load() {
				Page = {}
				Page.form = searchForm;
				Page.form.operId.value = Common.cOperator().id;
//				Page.bill = 'cheque_cancel';//Page.billOption = {queryName:,chequeId:id};
//				Page.preResult = function(result){
//					showInformation("支票撤销成功");
//				}
				
				Common.initDict(Page.form.status, "cheque_status", "全   部");		//初始化支票验证状态(查询form)
				Common.initDict(Page.form.bank, "bank", "全   部");					//初始化银行状态(查询form)
				var columns = [];
				columns[7] = {title:"操作",width:"5%",align:"center",order:false};
				columns[7].render = function(v,r){//显示'操作'的函数
					if(v == ChequeStatus.OPEN)
						return "<a href=# onclick=\"onDelete('"+r[0]+"','"+r[1]+"');return false;\">撤销<\/a>";
				}
				Page.qt = new QueryTable("cheque_list", "searchForm", "datalist", columns);
				Eui.showNavigation();
 				setPages(["listView","billDiv"]);
			}
			function onDelete(id,chequeNo) {
				var confirmString =   "确认撤销支票充值: " + TX.SHOW_INFO_LINEBREAK
									+ "支 票 号: " + chequeNo + TX.SHOW_INFO_LINEBREAK + TX.SHOW_INFO_LINEBREAK
									+ "相关的充值交易将被删除!";
				if(showQuestion(confirmString)){
					//Page.billOption.chequeId = id;
					DWR.call("tradeService.delCheque",
							 id,
							 function (result){
								showInformation("支票撤销成功");
								//显示凭证
								Eui.getBillHtml('content',{queryName:'cheque_cancel',chequeId:id});
								switchPage("billDiv");
								WebPrint.print('content')
							},
							{blockScreen:true});
				}
			}
			function goFirstPage(){
				switchPage('listView');
				Page.qt.showTable();
			}
		</script>
	</head>
	<body onload="load()">
		<div class="nav"><div id="nav">&nbsp;</div></div>
	
		<div id="listView">
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<input type="hidden" name="operId"/>
					<table cellSpacing="0" cellPadding="4" width="100%" border="0" >
						<tr>
							<td>
								<label>支 票 号</label>
								<input type="text" name="chequeNo" onblur="checkV(this,'long');">
							</td>
							<td>
								<label>支票所属银行</label>
								<select name="bank"><option></option></select>
							</td>
							<td>
								<label>支票状态</label>
								<select name="status"><option></option></select>
							</td>
							<td><button onclick="Page.qt.showTable()">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
		<div id="billDiv" class="form" width="100% " style="display:none;">
			<div class="formTitle">
				<div class="l">交易凭证</div>
				<div class="r">
					<button onclick="WebPrint.preview('content')">打印预览</button>
			 		<button onclick="WebPrint.print('content')">打印</button>
			 		<button onclick="goFirstPage()">返 回</button>
				</div>
			</div>
			<div  id="content"  align='center'></div>
		</div>
	</body>
</html>